<?php


namespace app\common\model;


use think\Model;
use think\Db;
class Goodsredpacket extends  Model
{
    protected $table = "goods_redpacket";

        public function getGoodsredpacket($field = "*",$condition = []){

            return  Db::name($this->table)->field($field)->where($condition)->select();
        }


        public function addGoodsredpacket($data){
            return db($this->table)->insertGetId($data);
        }

    public function editGoodsredpacket($condition, $update) {
        return db($this->table)->where($condition)->update($update);
    }
        public function countGoodsredpacket($condition){
            return db($this->table)->where($condition)->count();
        }
}